import { Injector, Pipe, PipeTransform } from '@angular/core';
import { AppMenuService } from '@app/shared/common/menu/app-menu.service';

@Pipe({ name: 'menuItemName' })
export class MenuItemNamePipe implements PipeTransform {
    private menuService: AppMenuService;

    constructor(injector: Injector) {
        this.menuService = injector.get(AppMenuService);
    }

    transform(kind: number) {
        if (!kind) {
            return '';
        }

        return this.menuService.getMenuName(kind);
    }
}
